#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include "./mqtt/mqtt.h"

int main(){
    pthread_t thread_ID;		//定义线程id

    pthread_create(&thread_ID, NULL, &cloud_mqtt_thread, NULL);	//创建一个线程执行mqtt客户端
    pthread_detach(thread_ID);	//设置线程结束收尸

    while (1) {
        /*发送函数, 参数：内容，长度，*/
        mqtt_data_write("my yes", 6, 0);//循环发布"my yes"
        sleep(3);						//睡眠3s
    }

    return 0;
}

